<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .fade-enter-active,
        .fade-leave-active{
            transition: opacity 0.5s;
        }
        .fade-enter,
        .fade-leave-to{
            opacity: 0;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="show=!show">展示</button>
        <transition name="fade">
            <demo v-if="show"></demo>
        </transition>
    </div>
</body>
<script src="../js/vue.js"></script>
<script>
    Vue.component("demo",{
        template:`
            <div >😊</div>
        `
    })
    let vm=new Vue({
        el:"#app",
        data:{
            show:false
        }
    })
</script>
</html>